window.onload = function () {
  init()
};

//初始化用户数据
async function init() {
    //调用应用控制层的findAll方法
    let userList = await ajaxGet("/user/findAll");

    //往userData中添加数据
    let str = "";
    for (let i = 0; i < userList.length; i++) {
        let user = userList[i];
        str += `<tr>
                    <td>${user.name}</td>
                    <td>${user.sex}</td>
                    <td>${user.money}</td>
                    <td>${user.birthday}</td>
                </tr>`;
    }
    $("userData").innerHTML = str;
}